//
//  PlatformAuthentication.m
//  reSearchDemo
//
//  Created by 科技 on 15/8/19.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import "PlatformAuthentication.h"

@interface PlatformAuthentication () {
    UIImageView *_trackView;
    UIImageView *_progressView;
}

@end

@implementation PlatformAuthentication

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"平台认证";
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"编辑" style:UIBarButtonItemStyleDone target:self action:@selector(releaseBtnAction:)];
    self.view.backgroundColor = [UIColor colorWithRed:247/255.0 green:247/255.0 blue:247/255.0 alpha:0.9];
    
    _trackView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 84, CGRectGetWidth(self.view.frame) - 10*2, 5)];
    _trackView.backgroundColor = [UIColor lightGrayColor];
    [UIView SetRoundedCorners:_trackView andcornerRadius:2.0 andborderWidth:1.0 andborderColor:[UIColor clearColor]];
    
    _progressView = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMinX(_trackView.frame), CGRectGetMinY(_trackView.frame), CGRectGetWidth(_trackView.frame), CGRectGetHeight(_trackView.frame))];
    _progressView.backgroundColor = [UIColor greenColor];
    [UIView SetRoundedCorners:_progressView andcornerRadius:2.0 andborderWidth:1.0 andborderColor:[UIColor clearColor]];
    _progressView.frame = CGRectMake(CGRectGetMinX(_trackView.frame), CGRectGetMinY(_trackView.frame), CGRectGetWidth(_trackView.frame)*0.5, CGRectGetHeight(_trackView.frame));
    UIView *stateView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_progressView.frame) - 10, CGRectGetMinY(_progressView.frame) - 10+CGRectGetHeight(_progressView.frame)/2, 20, 20)];;
    stateView.backgroundColor = [UIColor redColor];
    [UIView SetRoundedCorners:stateView andcornerRadius:CGRectGetWidth(stateView.frame)/2 andborderWidth:1.0 andborderColor:[UIColor clearColor]];
    
    NSArray *title = @[@"未认证",@"资料审核",@"开通认证"];
    for (int i = 0; i<title.count; i++) {
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(_trackView.frame) + CGRectGetWidth(_trackView.frame)/3*i, CGRectGetMaxY(_trackView.frame) + 10, CGRectGetWidth(_trackView.frame)/3, 20)];
        label.text = title[i];
        label.textAlignment = i;
        [self.view addSubview:label];
    }
    
    [self.view addSubview:_trackView];
    [self.view addSubview:_progressView];
    [self.view addSubview:stateView];
    
    UILabel *timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(_trackView.frame) + 50, 200, 20)];
    timeLabel.text = @"认证时间为:2015/5/7";
    
    UILabel *typeLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(timeLabel.frame)+ 10, 200, 20)];
    typeLabel.text = @"企业平台:个人平台";
    
    [self.view addSubview:timeLabel];
    [self.view addSubview:typeLabel];

    
}

#pragma mark --编辑按钮点击事件--
-(void)releaseBtnAction:(UIBarButtonItem *)sender {
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
